<template>
    <div :class="texCla">展示名称{{name}}</div>
    <el-button type="primary" @click="changeName">改变name</el-button>
    <el-button type="primary" @click="changeColor">改变颜色</el-button>
</template>

<style>
  .tred{ color:red}
  .tGren{ color: green;}
</style>
<script>
  export default {
    name:'Test',
    data(){
        return{
            name : '张三',age:20,texCla:'tred'
        }
    },
    methods:{
        changeName(){
            this.name = "李四"
        },
        changeColor(){
            this.texCla = "tGren"
        }
    }
  }

</script>